<%@page import="org.jeecgframework.web.util.StaticValue"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:1px;">
  <t:datagrid name="zyWarrantyPeriodList" sortName="sn" fitColumns="false" title="保期记录历史" actionUrl="zyWarrantyPeriodController.do?differHisDatagrid" idField="id" fit="true" queryMode="group">
  	 <t:dgCol title="主键"			field="id"		hidden="true"  queryMode="single"  width="120"></t:dgCol>
		   <t:dgCol title="版本号"		field="version"				queryMode="single"	query="false"  width="60"></t:dgCol>
		   <t:dgCol title="上传日期"		field="importDate"	formatter="yyyy-MM-dd"		queryMode="single"	query="false"  width="80"></t:dgCol>
		   <t:dgCol title="序列号"		field="sn"	 funname="view"		url="zyWarrantyPeriodController.do?goView&sn={sn}"		queryMode="single"	query="true"  width="85"></t:dgCol>
		   <t:dgCol title="集群"			field="cluster"		queryMode="single"	query="false"  width="70"></t:dgCol>
		   <t:dgCol title="保修截止日"	field="endOfWarranty" formatter="yyyy-MM-dd"	queryMode="single"	query="false"  width="80"></t:dgCol>
		   <t:dgCol title="服务合同"	field="serviceContract"				queryMode="single"	query="false"  width="80"></t:dgCol>
		   <t:dgCol title="合同开始日"	field="startContractCoverage"	formatter="yyyy-MM-dd"		queryMode="single"	query="false"  width="80"></t:dgCol>
		   <t:dgCol title="合同结束日"		field="endContractCoverage"		formatter="yyyy-MM-dd"		queryMode="single"	query="false"  width="80"></t:dgCol>
		   
		   <t:dgCol title="集群"			field="clusterColour"	hidden="true"	queryMode="single"	query="false"  width="120"></t:dgCol>
		   <t:dgCol title="保修截止日"	field="endOfWarrantyrColour" hidden="true"	queryMode="single"	query="false"  width="120"></t:dgCol>
		   <t:dgCol title="服务合同"	field="serviceContractColour"	hidden="true"			queryMode="single"	query="false"  width="120"></t:dgCol>
		   <t:dgCol title="合同开始日"	field="startContractCoverageColour"	hidden="true"		queryMode="single"	query="false"  width="120"></t:dgCol>
		   <t:dgCol title="合同结束日"		field="endContractCoverageColour"	hidden="true"			queryMode="single"	query="false"  width="120"></t:dgCol>
		   
		   <t:dgCol title="变更类型"		field="type"				queryMode="single"	query="false" dictionary="<%=StaticValue.DIC_FILE_SET_TYPE %>" width="60"></t:dgCol>
		   <t:dgCol title="处理状态"		field="status"				queryMode="single"	query="false" dictionary="<%=StaticValue.DIC_FILE_SET_STATUS %>" width="60"></t:dgCol>
		  <%--  <t:dgCol title="操作" field="opt" width="40"></t:dgCol>
  		   <t:dgDelOpt title="处理" url="zyWarrantyPeriodController.do?doSetStatus&id={id}" /> --%>
  </t:datagrid>
  </div>
</div>
<script>
	function colorStyle(){
		changeTergatColumnColor('clusterColour','red','zyWarrantyPeriodList','cluster','red');
		changeTergatColumnColor('endOfWarrantyrColour','red','zyWarrantyPeriodList','endOfWarranty','red');
		changeTergatColumnColor('serviceContractColour','red','zyWarrantyPeriodList','serviceContract','red');
		changeTergatColumnColor('startContractCoverageColour','red','zyWarrantyPeriodList','startContractCoverage','red');
		changeTergatColumnColor('endContractCoverageColour','red','zyWarrantyPeriodList','endContractCoverage','red');
	}
	/**
	*tergatColumn 对比目标列
	*value 对比值
	*datagrId datagrId
	*changeColumn 改变列
	*color 改变颜色 
	*/
	function changeTergatColumnColor(tergatColumn,value,datagrId,changeColumn,color){
		var rows = $("#"+datagrId+"").datagrid('getRows');//获取所有的数据行
		 for (var i = 0; i < rows.length; i++) {
	        var tergat= rows[i][''+tergatColumn+''];
	        if(tergat==value){
	        	$("td[field='"+changeColumn+"']").parent(".datagrid-row").eq(i).children("td[field='"+changeColumn+"']").css("color",color);
	        }
	     }  
	}
	
	function view(title,url){
		//url="zyEquipmentSpareController.do?goView&sn={sn}"
		addOneTab("查看设备详细",url,"");
	}
</script>
